package ch.janotta.slawo.da.tables;

import ch.janotta.slawo.da.Ability;
import ch.janotta.slawo.da.Focus;
import ch.janotta.slawo.da.Talent;
import ch.janotta.slawo.da.modifier.Modifier;
import ch.janotta.slawo.da.modifier.ModifierFactory;

public final class FereldanFreemanStartingModifiersTable extends BackgroundStartingModifiersTable {
  private static final Modifier[] MODIFIERS_RESULTS_TABLE = {
    ModifierFactory.getInstance(Ability.Communication),        // 2d6 ==  2
    ModifierFactory.getInstance(Focus.SelfDiscipline),         // 2d6 ==  3
    ModifierFactory.getInstance(Focus.SelfDiscipline),         // 2d6 ==  4
    ModifierFactory.getInstance(Focus.AnimalHandling),         // 2d6 ==  5
    ModifierFactory.getInstance(Focus.Riding),                 // 2d6 ==  6
    ModifierFactory.getInstance(Ability.Willpower),            // 2d6 ==  7
    ModifierFactory.getInstance(Ability.Willpower),            // 2d6 ==  8
    ModifierFactory.getInstance(Focus.Driving),                // 2d6 ==  9
    ModifierFactory.getInstance(Focus.Swimming),               // 2d6 == 10
    ModifierFactory.getInstance(Focus.Swimming),               // 2d6 == 11
    ModifierFactory.getInstance(Ability.Strength),             // 2d6 == 12
  };

  private Modifier[] backgroundModifiers = new Modifier[] {
      ModifierFactory.getInstance(Ability.Constitution),
      ModifierFactory.getInstance(pickOneRandomFocus(Focus.Stamina, Focus.Courage)),
      ModifierFactory.getInstance(Talent.Speak_Read_TradeTongue),
      getNonDuplicateRandomModifier(true),
      getNonDuplicateRandomModifier(false)
  };

  @Override
  public Modifier getTableResult(int index) {
    return MODIFIERS_RESULTS_TABLE[index];
  }

  @Override
  public Modifier[] getAllStartingModifiers() {
    return backgroundModifiers;
  }
}
